feat: remove ClientOnly children from server build#6193
feat: remove ClientOnly children from server build#6193schiller-manuel merged 3 commits intomainfrom
Conversation
WalkthroughAdds server-side detection and transformation for ClientOnly JSX, a new client-only demo route/component with E2E tests, and integrates JSX candidate collection and handling into the server-fn compiler pipeline. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant S as Source (TSX files)
participant C as ServerFnCompiler
participant H as handleClientOnlyJSX
participant R as Server Renderer
participant B as Browser (Client)
Note over S,C: Build / compile time
S->>C: Parse AST, detect ClientOnly imports and JSX usage
C->>H: Send matching JSXElement node(s) (server env)
H-->>C: Return transformed JSX (children removed, self-closing)
C-->>R: Emit server-safe code / HTML with preserved fallbacks
Note over R,B: Runtime / hydration
R->>B: Send server-rendered HTML (fallback placeholders)
B->>B: Hydration loads client bundles
B->>B: Client-only components mount and render (e.g., WindowSize)
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)**/*.{ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{js,ts,tsx}📄 CodeRabbit inference engine (AGENTS.md)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (3)
Comment |
|
View your CI Pipeline Execution ↗ for commit c4faeee
☁️ Nx Cloud last updated this comment at |
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.